package my.com.baidu.rigel.pss.wbdp.pojo.accstruct;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * 关键词信息
 * 
 * @author fanhongjie
 * 
 */
public class Word implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8824091366532302604L;

	/** 意愿初始化 */
	public static final int DESIRE_INIT = AccConstant.DESIRE_DEFAULT;

	/** 匹配模式初始化 */
	public static final int MATCH_INIT = AccConstant.MATCH_DEFAULT;

	/** 核心 */
	public static final int DESIRE_CORE = AccConstant.DESIRE_CORE;

	/** 商机 */
	public static final int DESIRE_BISIOPP = AccConstant.DESIRE_BISIOPP;

	/** 拓展 */
	public static final int DESIRE_EXPAND = AccConstant.DESIRE_EXPAND;

	/** 精确 */
	public static final int MATCH_ACCURATE = AccConstant.MATCH_ACCURATE;

	/** 短语 */
	public static final int MATCH_PHRASE = AccConstant.MATCH_PHRASE;
	/** 广泛 */
	public static final int MATCH_WIDE = AccConstant.MATCH_WIDE;
	/** 核心 */
	public static final String DESIRE_CORE_STR = AccConstant.DESIRE_CORE_STR;
	/** 商机 */
	public static final String DESIRE_BISIOPP_STR = AccConstant.DESIRE_BISIOPP_STR;
	/** 拓展 */
	public static final String DESIRE_EXPAND_STR = AccConstant.DESIRE_EXPAND_STR;
	/** 精确 */
	public static final String MATCH_ACCURATE_STR = AccConstant.MATCH_ACCURATE_STR;
	/** 短语 */
	public static final String MATCH_PHRASE_STR = AccConstant.MATCH_PHRASE_STR;
	/** 广泛 */
	public static final String MATCH_WIDE_STR = AccConstant.MATCH_WIDE_STR;

	/** 关键词ID */
	private long id;

	/** 关键词字面 */
	private String name;

	/** 购买关系ID */
	private long winfoID;

	/** 单元ID */
	private long unitID;

	/** 计划ID */
	private long planID;

	/** 匹配模式 63精确，31短语，15广泛 */
	private int matchType;

	/** 意愿类型 1|2|3:核心|商机|拓展 */
	private int desireType;
	/** 出价(老词有出价) */
	private Double price;

	/** 分类结果已确定的二级行业名 */
	private String industry2Name; //
	/** 分类服务中返回的二级行业列表 */
	private List<String> unclassfiedIndustry2Names;
	/** 一级业务 */
	private String biz1;
	/** 分类结果已确定需求类型 */
	private String requireType;
	/** 分类服务未分类的需求类型列表 */
	private List<String> unclassfiedRequireTypes;
	/** 词性 */
	private String wordType;
	/** 变形金刚需要使用的单元名 */
	private String unitName;

	public Word() {
		this.id = AccConstant.ACC_DEFAULT_LONG;
		this.name = AccConstant.ACC_DEFAULT_STRING;
		this.winfoID = AccConstant.ACC_DEFAULT_LONG;
		this.unitID = AccConstant.ACC_DEFAULT_LONG;
		this.planID = AccConstant.ACC_DEFAULT_LONG;
		this.matchType = AccConstant.MATCH_DEFAULT;			//初始匹配模式 为0
		this.desireType = AccConstant.DESIRE_DEFAULT;		//初始意愿 为0
		this.price = AccConstant.WORD_DEFAULT_PRICE;
		this.industry2Name = AccConstant.ACC_DEFAULT_STRING;
		this.unclassfiedIndustry2Names = new ArrayList<String>(AccConstant.ACC_DEFAULT_COLLECTION_SIZE);
		this.biz1 = AccConstant.ACC_DEFAULT_STRING;
		this.requireType = AccConstant.ACC_DEFAULT_STRING;
		this.unclassfiedRequireTypes = new ArrayList<String>(AccConstant.ACC_DEFAULT_COLLECTION_SIZE);
		this.wordType = AccConstant.ACC_DEFAULT_STRING;
		this.unitName = AccConstant.ACC_DEFAULT_STRING;
	}

	public String getUnitName() {
		return unitName;
	}

	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public long getWinfoID() {
		return winfoID;
	}

	public void setWinfoID(long winfoID) {
		this.winfoID = winfoID;
	}

	public int getMatchType() {
		return matchType;
	}

	public long getUnitID() {
		return unitID;
	}

	public void setUnitID(long unitID) {
		this.unitID = unitID;
	}

	public long getPlanID() {
		return planID;
	}

	public void setPlanID(long planID) {
		this.planID = planID;
	}

	public void setMatchType(int matchType) {
		this.matchType = matchType;
	}

	public int getDesireType() {
		return desireType;
	}

	public void setDesireType(int desireType) {
		this.desireType = desireType;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public String getIndustry2Name() {
		return industry2Name;
	}

	public void setIndustry2Name(String industry2Name) {
		this.industry2Name = industry2Name;
	}

	public List<String> getUnclassfiedIndustry2Names() {
		return unclassfiedIndustry2Names;
	}

	public void setUnclassfiedIndustry2Names(
			List<String> unclassfiedIndustry2Names) {
		this.unclassfiedIndustry2Names = unclassfiedIndustry2Names;
	}

	public String getBiz1() {
		return biz1;
	}

	public void setBiz1(String biz1) {
		this.biz1 = biz1;
	}

	public String getRequireType() {
		return requireType;
	}

	public void setRequireType(String requireType) {
		this.requireType = requireType;
	}

	public String getWordType() {
		return wordType;
	}

	public void setWordType(String wordType) {
		this.wordType = wordType;
	}

	public List<String> getUnclassfiedRequireTypes() {
		return unclassfiedRequireTypes;
	}

	public void setUnclassfiedRequireTypes(List<String> unclassfiedRequireTypes) {
		this.unclassfiedRequireTypes = unclassfiedRequireTypes;
	}

	/**
	 * 获取业务分类结果与意愿分类结果
	 * 
	 * @return
	 */
	public String getClassfiedAndDisireStr() {
		StringBuilder sb = new StringBuilder();
		return sb.append(this.industry2Name).append("_")
				.append(this.requireType).append("_").append(this.wordType)
				.append("_").append(this.desireType).toString();
	}

	/**
	 * 获取业务分类结果 一级业务 需求类型 词性
	 * 
	 * @return
	 */
	public List<String> getUnclassfiedStrs() {
		List<String> unclassiedStrs = new ArrayList<String>();
		for (int i = 0; i < this.unclassfiedRequireTypes.size(); i++) {
			StringBuilder sb = new StringBuilder();
			sb.append(this.biz1).append("_")
					.append(this.unclassfiedRequireTypes.get(i)).append("_")
					.append(this.wordType);
			unclassiedStrs.add(sb.toString());
		}
		return unclassiedStrs;
	}
	
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
		
	}
}
